#include "junix.h"

int main(int argc, char **argv)
{
	printf("pid:%ld\n", syscall(SYS_getpid));

	int fd = syscall(SYS_open, "X", O_RDWR|O_CREAT, 0644);
	if(fd==-1)
		err_sys("syscall open");

	char buf[]="hello,world!\n";
	ssize_t len;

	len = syscall(SYS_write,fd, buf, strlen(buf) );
	if( len != strlen(buf))
		err_sys("write");

	if( syscall(SYS_close, fd) == -1)
		err_sys("syscall close");

    exit(0);
}

